<?php

namespace app\admin\validate;

use think\Validate;

class Route extends Validate
{
    protected $rule =   [
        'name' => 'require',
        'path' => 'require',
        'component' => 'require',
        'meta' => 'require',
        'id' => 'require',
        'ids' => 'require',
        'sortOrder' => 'require',
        'permission' => 'require',
    ];

    protected $message = [
        'name.require' => '缺少参数name',
        'path.require' => '缺少参数path',
        'component.require' => '缺少参数component',
        'meta.require' => '缺少参数meta',
        'id.require' => '缺少参数id',
        'ids.require' => '缺少参数ids',
        'sortOrder.require' => '缺少参数sortOrder',
        'permission.require' => '缺少参数permission',
    ];

    protected $scene = [
        'add' => ['name', 'path', 'component'],
        'addBtn' => ['permission'],
        'edit' => ['id'],
        'sort' => ['id', 'sortOrder'],
        'del' => ['id'],
        'dels' => ['ids'],
    ];
}